1. Field of the Invention
Method and apparatus for dynamic invocation of program utilities from a high level application program. More particularly, this invention provides an improved apparatus and method for transfer of input/output status information and input/output records with respect to a sort utility invoked from an application program, both the sort utility and application program executing under control of an operating system in a multi-programming environment.
2. Description of the Prior Art
In the prior art, in order to provide a user, such as an application program written in COBOL, with input/output information and data set status, a sort program invoked by the application program returns control to the application program to manage input/output processes executed under control of an operating system, including reads from the input file and writes to the output file. This transfer in control between the sort utility and the caller (application program) results in the expenditure of significant time, which may adversely impact the execution speed of the sort. The advantage is that the operating system passes status information to its caller, in this case, the application program.
In this regard, the current implementation of the SORT verb in the IBM VS COBOL for OS/VS (Program Number 5740-CB1) using OS/VS SORT/MERGE Release 5 (Program Number 5740-SM1), requires that COBOL manage I/O activities, with one record at a time passed over the interface between the application program written in COBOL and the sort utility. This is described, somewhat, in IBM VS COBOL for OS/VS, IBM Publication GC26-3857-2. The OS/VS SORT/MERGE Release 5 parameter list, used when dynamically invoking sort, is described in IBM Publication SC33-4035-7, OS/VS Sort/Merge Programmer's Guide, pages 100-112. This parameter list provides, inter alia, the addresses of any provided exits E15 (for processing input records) and E35 (for processing output records). As will be further described, the use of exists E15 and E35 for processing input and output records, respectively, is quite inefficient, requiring that individual records be passed, along with transfers of control, over the interface between the sort utility and the user, or application, program.
This prior art parameter list also provides the beginning and ending addresses of any MERGE, SORT, RECORD, MODS, DEBUG, and ALTSEQ statements, and an extension to this parameter list known in the art provides beginning and ending addresses for each of SUM, INCLUDE/OMIT, OUTREC, and INREC statements. However, in these prior art parameter lists, no provision is made for passing all control statements, nor exits E18 and E39 (for providing error handling, as will be described more fully hereafter), the latter being separate entities in a library not under control of the application program.
High level language calls, such as from COBOL, to these prior art sort utilities will always provide exits E15 and E35. The application programmer will utilize the sort verb which, when compiled by the high level language compiler, will provide exits E15 and E35, and will include their addresses in the parameter list when invoking the prior art sort utilities. However, when these sort utilities are invoked explicitly by a user not using a high level language compiler, the user (not the compiler) may build its own parameter list directly and invoke sort using a system services LINK, ATTACH or XCTL (transfer control) protocol. If the caller does not, when using LINK, ATTACH or XCTL protocols, provide an exit E15, then these prior art sorts will use the ddname "sortin" (or user chosen replacement) for the input file and will do their own execute channel program (EXCP) or basic sequential access method (BSAM) input processing. Similarly, if exit E35 is not provided, these sorts will do their own output processing using ddname "sortout" (or user chosen replacement). Data definition name (ddname) is a name used by the application program to identify to the operating system and utility programs the names of one or more data sets. These prior art sort utilities do not provide the ability to process user identified sortin and sortout data sets directly on behalf of users invoking sort by use of a high language sort verb, such as in COBOL.
Whitlow, U.S. Pat. No. 4,210,961 describes a sorting system in which blocks of data are read from the input file and written to the output file. However, there is no discussion of selective control of I/O by the sort process and caller, nor of the manner in which, when sort controls I/O, status and error information is preserved and passed to the caller.